package com.csii.common;

import com.csii.result.APIResult;

import java.util.List;

/**
 * @ClassName: ResultUtils
 * @Author: zhanghao
 * @description: 用于校验查询的结果集，并返回相应的结果。
 * @return: APIResult
 * @Date: 2021/6/30 12:17
 * @Version: 1.0
 */
public class ResultUtils {

    public static APIResult<?> resultCheck(List<?> resultList, String message){
        if (resultList == null || resultList.size() == 0){
            return APIResult.failResult(resultList, message);
        } else {
            return APIResult.successResult(resultList);
        }
    }

}
